package rpd.mapper;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import rpd.model.TbUserResumeRef;
import rpd.model.TbUserResumeRefExample;
import rpd.model.TbUserResumeRefKey;

public interface TbUserResumeRefMapper {
    long countByExample(TbUserResumeRefExample example);

    int deleteByExample(TbUserResumeRefExample example);

    @Delete({
        "delete from tb_user_resume_ref",
        "where URR_ID = #{urrId,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(TbUserResumeRefKey key);

    @Insert({
        "insert into tb_user_resume_ref (URR_ID, user_id, ",
        "resume_id)",
        "values (#{urrId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, ",
        "#{resumeId,jdbcType=VARCHAR})"
    })
    int insert(TbUserResumeRef record);

    int insertSelective(TbUserResumeRef record);

    List<TbUserResumeRef> selectByExample(TbUserResumeRefExample example);

    @Select({
        "select",
        "URR_ID, user_id, resume_id",
        "from tb_user_resume_ref",
        "where URR_ID = #{urrId,jdbcType=VARCHAR}"
    })
    @ResultMap("rpd.mapper.TbUserResumeRefMapper.BaseResultMap")
    TbUserResumeRef selectByPrimaryKey(TbUserResumeRefKey key);

    int updateByExampleSelective(@Param("record") TbUserResumeRef record, @Param("example") TbUserResumeRefExample example);

    int updateByExample(@Param("record") TbUserResumeRef record, @Param("example") TbUserResumeRefExample example);

    int updateByPrimaryKeySelective(TbUserResumeRef record);

    @Update({
        "update tb_user_resume_ref",
        "set user_id = #{userId,jdbcType=VARCHAR},",
          "resume_id = #{resumeId,jdbcType=VARCHAR}",
        "where URR_ID = #{urrId,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(TbUserResumeRef record);
}